import { createI18n } from 'vue-i18n'
import { nextTick } from 'vue'

let language = 'en';
const i18n = createI18n({
    legacy: false, // you must set `false`, to use Composition API
    locale: language,
    fallbackLocale: language,
    messages: {
    }
})
export async function loadLocaleMessages(locale) {
  const messages = await import(`../lang/${locale}/front.json`)
  i18n.global.setLocaleMessage(locale, messages.default)
  return nextTick()
}
loadLocaleMessages(language)
export default i18n;
